//
//  DetaileView.m
//  FoodFamily
//
//  Created by dlios on 15-6-25.
//  Copyright (c) 2015年 guoBang. All rights reserved.
//

#import "DetaileView.h"

@implementation DetaileView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
-(instancetype)initWithFrame:(CGRect)frame and:(NSMutableArray *)array
{
    self = [super initWithFrame:frame];
    if (self) {
        self.detailearray = [NSMutableArray arrayWithArray:array];
       // NSLog(@"self.detailearrayself.detailearrayself.detailearrayself.detailearray%@",self.detailearray);
        [self qwer];
    }
    return self;

}
-(void)qwer
{//button.frame =CGRectMake(23 + i % 3 * (94 + 23), (24 + i / 3 * (132 + 50)), 94, 132);
    for (int i = 0; i <self.detailearray.count; i++) {
        //NSLog(@"8949879898654654%ld",self.detailearray.count);
        UIImageView *view = [[UIImageView alloc]initWithFrame:CGRectMake(15 + i % 3 * (94 + 23), (20 + i / 3 * (100 + 20)),100, 100)];
        [self addSubview:view];
        Movie *movie = [self.detailearray objectAtIndex:i];
        NSURL *url = [NSURL URLWithString:movie.imagePath];
        [view sd_setImageWithURL:url];
        
    }
}
-(void)setMovie:(Movie *)movie
{
    if (_movie !=movie) {
        [_movie release];
        _movie = [movie retain];
    }
    NSURL *url = [NSURL URLWithString:movie.imagePathLandscape];
       [self.imageview sd_setImageWithURL:url];
 
}
@end
